<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('库存类型列表')" />
	<style type="text/css">
		label.layui-form-label {padding: 10px -0px 0px 10px;}
	</style>
</head>
<body class="no-skin">
<div class="main-container" id="main-container">
	<div class="main-content">
	    <div class="north">
	        <div class="north-content">
	            <form>
					<th:block th:include="listinclude :: searchTop" />
				</form>
	        </div>
	    </div>
	    <div class="mid-content">
	        <table class="layui-hide" id="dhtable" lay-filter="ftable"></table>
	    </div>
	</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: motif-alone" />
<script type="text/html" id="checkbox_bXjXc">
    <input type="checkbox" value="{{d.guid}}" lay-skin="switch" lay-text="启用|停用" name="bXjXc" lay-filter="change" {{ d.bXjXc? 'checked' : '' }}>
</script>
<script th:inline="javascript">
    /*<![CDATA[*/
    var gridColumns = [[${gridColumns}]];
    var moduleTable=[[${moduleTable}]];
	var prefix="/base/basestocktype";
    /*]]>*/
</script>
 <script type="text/javascript">
 var $,layer,form,table,laydate,util,wherestr={};
 layui.use(['table','form','layer','jquery'], function () {
      $ = layui.$,layer = layui.layer,form = layui.form,table = layui.table;
	$.tablelist.init({
		elem: '#dhtable'
		,url: prefix+"/list"
		,totalRow: gridColumns.totalRow
   		,cols: [gridColumns.gridBody
		]
		,defaultToolbar: [{title:'列设置',layEvent: 'fieldSet',icon: 'layui-icon-set'}]
		,height:'full-' + ( $('.north').height()+36),
	});
	//监听开关动作
 	form.on('switch(change)', function(obj){
 		var data={};
 		data['guid']=obj.value;
 		if(obj.elem.checked==true){
 			data[obj.elem.name]=1;
  	    	$.operate.post(prefix + "/editpost", {'baseStockTypeItems':JSON.stringify([data])}); 
    	}else{
    		data[obj.elem.name]=0;
	    	$.operate.post(prefix + "/editpost", {'baseStockTypeItems':JSON.stringify([data])});
	    }
    });
  	//搜索按钮
 	$('#btn-search').on('click', function () {
 		$.each(wherestr,function(i,v){$("#"+i).val()?wherestr[i]=$("#"+i).val():wherestr[i]='';});//动态获取条件的值
        table.reload('dhtable', {page: {curr: 1},where:wherestr});
    });
 	//监听下拉框——添加条件
 	form.on('select(fft)', function(obj){
 		addMore(this);
 	});
})
 </script>
</body>
</html>